import java.util.Scanner;

public class test {






    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int m = scanner.nextInt();
        int n = scanner.nextInt();
        int a = m % n;
        int b = 1;
        System.out.println(b);
//        while(a != 0){
//            m = n;
//            n = a;
//            a = m % n;
//        }
//        System.out.println("这俩个数的最大公约数为" + n);
    }
}



